<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./bootstrap/bootstrap.min.css">
  <style>
    #box {
      width: 200px;
      height: 40px;
      background-color: rgba(0, 0, 0, .3);
      margin: 100px auto;
      color: #fff;
      text-align: center;
      line-height: 40px;
    }
  </style>
</head>

<body>

  <div id="box" class="toast">我是轻提示</div>

  <script src="./bootstrap/bootstrap.min.js"></script>
  <script>
    const toast = new bootstrap.Toast(document.querySelector('#box'), {
      animation: true,
      autohide: true,
      delay: 3000
    })

    toast.show()

  </script>
</body>

</html>